This exercise teaches you how to add new objects, and should take about 20 minutes to complete.
Opening the Sample Simulation
If you already have the Tutorial sample simulation open, choose the File / Revert to Saved menu item, which will return the simulation to the same state that it was in when you first opened it. Otherwise, go through the following steps to open it.
If you don't already have AstroGrav running, double-click on the AstroGrav application icon () to start it running.
When the Open Simulation file chooser dialog is displayed, navigate to and open the Sample Simulations folder.
Select and open the Tutorial.ast file in the English folder.
The Tutorial sample simulation will then open, and you will see the simulation's three windows displayed on your screen.
Editing the Units
In this exercise, you are going to add a star in a hyperbolic orbit that will pass through the Solar System, and see what effect it has on the orbits of the planets. In the Tutorial sample simulation, the units for the radius, luminosity, and mass are initially kilometers, Watts, and kilograms. Go through the following steps to learn how to edit the units to something more convenient for adding the new star.
Choose the Edit / Units... menu item, which will result in the Units dialog being displayed.
In the 'Radius' popup menu, select 'Solar Radii'.
In the 'Luminosity' popup menu, select 'Solar luminosities'.
In the 'Mass' popup menu, select 'Solar masses'.
Accept the dialog while watching the 'Radius', 'Luminosity', and 'Mass' columns of the Tutorial: Table window, and notice how the information changes to reflect your new choice of units.
Adding a New Star
You are now ready to add the new star to the simulation. You will be creating a star in a hyperbolic orbit that will pass through the Solar System, and whose closest approach to the Sun is 1.0AU (the average distance of the Earth from the Sun). The formula for the closest approach on a hyperbolic orbit is
so a value of 1.0AU for the semi-major axis and 2.0 for the eccentricity will do. Go through the following steps to learn how to add the new star.
Choose the Edit / Add Object... menu item, which will result in the Editor of 'Object 18' dialog being displayed. The default name of 'Object 18' indicates that the new object is the 18th object in the simulation.
Click on the 'show more choices' icon in the top-left corner of the window, and notice how only the Physical Elements and Absolute Elements are editable, with all other fields being marked as uneditable ('_'). This means that in order to use this dialog to enter your new star, you will have to specify the new star's position and velocity in terms of Absolute Elements, which is not very convenient.
Cancel the Editor of 'Object 18' dialog, in preparation for using an alternative method which will allow you to specify the new star's position and velocity in terms of Orbital Elements instead of Absolute Elements.
Now, click on the Sun without holding down any of the modifier keys, and check that the Sun is now selected. Selecting the Sun before adding the new object tells AstroGrav that the Sun is to be the parent of the new object.
Choose the Edit / Add Object... menu item, which will result in the Editor of 'Sun/10' dialog being displayed. The default name of 'Sun/10' indicates that new object is the 10th object orbiting the Sun. Notice how the lower panel now contains Orbital Elements instead of Absolute Elements.
Enter 'New Star' in the 'Name' field, and then use the tab key to move to the next field.
Click on the 'Color' field, choose a color from the 'Star Swatches' (any will do), accept the dialog, and then use the tab key to move to the next field.
Enter '0.5' in the 'Radius' field (half the radius of the Sun), and then use the tab key to move to the next field.
Enter '0.5' in the 'Luminosity' field (half the luminosity of the Sun), and then use the tab key to move to the next field.
Enter '0.5' in the 'Mass' field (half the mass of the Sun), and then use the tab key to move to the next field.
Enter '1' in the 'Semi-Major' field, and then use the tab key to move to the next field.
Enter '2' in the 'Eccentricity' field, and then use the tab key to move to the 'True Long'.
Enter '248' in the 'True Long' field to specify a suitable position for the new star on its orbit.
Accept the dialog, and notice that the new star has appeared in all three windows with the status bars now showing '18 Objects' instead of '17 Objects'. In the Tutorial: Model window, a red line has appeared in the top-right corner of the window, which is part of the new star's orbit (the red color indicates that the orbit is a hyperbola rather than an ellipse). In the Tutorial: Table window, a new row for 'New Star' has appeared between the rows for 'Neptune' and 'Pluto'. In the Tutorial: Tree window, 'New Star' has appeared at the bottom.
If instead of a star, you want to a add a new planet, moon, or asteroid to a simulation, the only changes to this procedure that you need to make are to choose the color from the 'Planet Swatches' instead of the 'Star Swatches', and to enter '0' in the 'Luminosity' field to make the object non-luminous.
Evolving the Modified Simulation
Go through the following steps to see what happens when you start the modified simulation running.
Choose the Window / New Model menu item (or the tool), and notice how a new Tutorial: Model 2 window appears. This new window shows a much more convenient view of the simulation, with the center of mass of the system being in the center of the window. You could have manipulated the original Tutorial: Model window instead, but it's useful to have two model windows visible - one showing the overall view, and the other showing a close-up of the inner Solar System.
Choose the Evolve / Run Forward menu item (or the tool), which will start the simulation running forward in time. Notice how the time/date on the left of the status bar increases by one day at a time.
Flip between the two model model windows by clicking on them, and notice how the planets in the inner Solar System are moving around quite quickly, whereas the planets in the outer Solar System are moving around much more slowly, and the new star is only approaching the Solar System very slowly.
Now, choose the Evolve / Settings... menu item (or the tool), which will result in the Evolve Settings input dialog being displayed.
Change the time step from 1.0 to 10 days and accept the dialog. Notice how the simulation now runs much more quickly, with the time/date on the left of the status bar now increasing by ten days at a time.
Watch what happens on the Tutorial: Model 2 window, choosing the View / Magnification / Larger menu item (or the tool) occasionally to increase the magnification as the new star approaches the Solar System. Notice what a mess the new star makes of the Solar System as it passes close to the Sun!
Finally, when the new star has moved off far from the Sun again, stop the simulation running by using the Evolve / Stop menu item (or the tool).
You may wish to try running the simulation backward again to watch the Solar System repair itself, or to experiment with using different values for the new star's fields to see how the changes effect the way that the simulation evolves.
Next: Adding New Families of Objects
You've now completed Exercise 6, and are ready to move on to Exercise 7, which teaches you how to add new families of objects.